package com.huike.controller.system;

import com.huike.dto.SysPageQueryDTO;
import com.huike.dto.SysRolePageQueryDTO;
import com.huike.result.PageResult;
import com.huike.result.Result;
import com.huike.service.system.SysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("system/role/")
public class SysRoleController {
    @Autowired
    private SysRoleService sysRoleService;

    /**
     * 分页查询
     * @param queryDTO
     * @return
     */
    @RequestMapping("list")
    public PageResult list(SysRolePageQueryDTO queryDTO)
    {
        return sysRoleService.RolePageQuey(queryDTO);
    }
    /**
     * 修改角色状态
     */
    @RequestMapping("changeStatus")
    public Result<String> changeStatus(Integer status)
    {
        sysRoleService.changeStatus(status);
        return Result.success();
    }
}
